1400 |
Is it possible to define my values for sorting
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("C1"):SortType := 6/*SortUserDataString*/ oG2antt:Columns():Add("C2") oItems := oG2antt:Items() h := oItems:AddItem("Cell 1") oItems:SetProperty("CellData",h,0,"3.your extra data") oItems:SetProperty("CellValue",h,1,"SortValue=3") h := oItems:AddItem("Cell 1.1") oItems:SetProperty("CellData",h,0,"1.your extra data") oItems:SetProperty("CellValue",h,1," SortValue=1") h := oItems:AddItem("Cell 1.2") oItems:SetProperty("CellData",h,0,"5.your extra data") oItems:SetProperty("CellValue",h,1," SortValue=5") h := oItems:AddItem("Cell 1.3") oItems:SetProperty("CellData",h,0,"2.your extra data") oItems:SetProperty("CellValue",h,1," SortValue=2") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1399 |
I have multiple dropdown lists, that are depending on each other, that means that the values in dropdown list no. 2 is based on the users selection in dropdown list no 1. How can I do this
PROCEDURE OnEditOpen(oG2antt) LOCAL oEditor LOCAL oItems LOCAL c,v oItems := oG2antt:Items() v := oItems:CellValue(oItems:FocusItem(),0) c := oItems:CellCaption(oItems:FocusItem(),0) oEditor := oG2antt:Columns:Item(1):Editor() oEditor:ClearItems() oEditor:AddItem(v,Transform(c,"")) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oEditor LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:EditOpen := {|| OnEditOpen(oG2antt)} /*Occurs when the edit operation starts.*/ oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumn := oG2antt:Columns():Add("DropDownList") oEditor := oColumn:Editor() oEditor:EditType := 3/*DropDownListType*/ oEditor:AddItem(1,"First") oEditor:AddItem(2,"Second") oEditor:AddItem(3,"Third") oG2antt:DrawGridLines := -1/*exAllLines*/ oG2antt:Columns():Add("DropDownList-Related"):Editor():EditType := 3/*DropDownListType*/ oItems := oG2antt:Items() oItems:SetProperty("CellValue",oItems:AddItem(1),1,-1) oItems:SetProperty("CellValue",oItems:AddItem(2),1,-1) oItems:SetProperty("CellValue",oItems:AddItem(3),1,-1) oItems:SetProperty("LockedItemCount",2/*exBottom*/,1) h := oItems:LockedItem(2/*exBottom*/,0) oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("ItemDividerLineAlignment",h,2/*DividerTop*/) oItems:SetProperty("CellEditorVisible",h,0,0/*exEditorHidden*/) oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/) oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/) oItems:SetProperty("CellValue",h,0,"The drop down editor in the second column is filled during the <b>EditOpen event</b>, and the values are based on the selection on the first column.") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1398 |
Is it possible background color displayed when the mouse passes over an item
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Def") oG2antt:SetProperty("HotBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,128 } ) , .F. )) oG2antt:SetProperty("HotForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oItems := oG2antt:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1397 |
Is it possible to magnify a specified date and apply a different background color
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oInsideZoom LOCAL oItems LOCAL hA,hB oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:DrawLevelSeparator := 0/*exLevelNoLine*/ oChart:SetProperty("PaneWidth",.F.,64) oChart:FirstVisibleDate := "11/23/2011" oChart:LevelCount := 3 oChart:FirstWeekDay := 1/*exMonday*/ oChart:AllowInsideZoom := .T. oChart:InsideZooms():Add("11/29/2011"):AllowCustomFormat := .T. oInsideZoom := oChart:InsideZooms:Item("11/29/2011") oInsideZoom:Width := 68 oInsideZoom:CustomFormat():SetProperty("BackColorChart",AutomationTranslateColor( GraMakeRGBColor ( { 224,224,224 } ) , .F. )) oItems := oG2antt:Items() hA := oItems:AddItem("Task A") oItems:AddBar(hA,"Task","11/24/2011","11/26/2011","A") hB := oItems:AddItem("Task B") oItems:AddBar(hB,"Task","11/28/2011","12/01/2011","B") oItems:AddLink("LinkAB",hA,"A",hB,"B") oItems:SetProperty("Link","LinkAB",9/*exLinkStyle*/,2) oItems:SetProperty("Link","LinkAB",10/*exLinkWidth*/,2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1396 |
Could you please tell me how to add multiple bars to the one line
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():FirstVisibleDate := "01/01/2002" oG2antt:Columns():Add("Task") oItems := oG2antt:Items() h := oItems:AddItem("Task") oItems:AddBar(h,"Task","01/02/2002","01/04/2002","A") oItems:AddBar(h,"Task","01/06/2002","01/10/2002","B") oItems:SetProperty("ItemBar",h,"A",33/*exBarColor*/,255) oItems:AddLink("AB",h,"A",h,"B") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1395 |
My development environment does not have any Object,GetOcx,DefaultDispatch,GetControlUnknown,nativeObject, ... property, is there any alternative I can pass the component to PrintExt so I can get printed
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h1,h2 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","K1") h2 := oItems:AddItem("Task 2") oItems:AddBar(h2,"Task","01/05/2001","01/07/2001","K2") oItems:AddLink("L1",h1,"K1",h2,"K2") oItems:SetProperty("Link","L1",6/*exLinkStartPos*/,0) oG2antt:EndUpdate() oG2antt:Template := "Dim p;p = CreateObject(`Exontrol.Print`);p.PrintExt = Me;p.AutoRelease = False;p.Preview();" oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1394 |
My development environment does not have any Object,GetOcx,DefaultDispatch,GetControlUnknown,nativeObject, ... property, is there any alternative I can pass the component to PrintExt so I can get printed
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oPrint LOCAL oItems LOCAL h1,h2 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:Chart():FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","K1") h2 := oItems:AddItem("Task 2") oItems:AddBar(h2,"Task","01/05/2001","01/07/2001","K2") oItems:AddLink("L1",h1,"K1",h2,"K2") oItems:SetProperty("Link","L1",6/*exLinkStartPos*/,0) oG2antt:EndUpdate() oPrint := CreateObject("Exontrol.Print") oPrint:PrintExt := oG2antt:ExecuteTemplate("me") oPrint:Preview() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1393 |
Is it possible to display the bar's captions or labels with a different font/size
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oG2antt:DefaultItemHeight := 24 oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,64) oChart:FirstVisibleDate := "01/01/2001" oChart:LevelCount := 2 oItems := oG2antt:Items() h := oItems:AddItem("Default") oItems:AddBar(h,"Task","01/02/2001","01/06/2001","","This is a the control's font") oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) h := oItems:AddItem("Smaller") oItems:AddBar(h,"Task","01/02/2001","01/06/2001","","<font ;5>This is a the control's font with a smaller size") oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) h := oItems:AddItem("Larger") oItems:AddBar(h,"Task","01/02/2001","01/06/2001","","<font ;15>This is a the control's font with a larger size") oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) h := oItems:AddItem("Tahoma 1") oItems:AddBar(h,"Task","01/02/2001","01/06/2001","","<font Tahoma>This is using a Tahoma font") oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) h := oItems:AddItem("Tahoma 2") oItems:AddBar(h,"Task","01/02/2001","01/06/2001","","<font Tahoma;14>This is using a <b>Tahoma</b> font with a different size") oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1392 |
How can I apply the same ConditionalFormat on more than 1(one) column (multiple columns and not on item)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumns LOCAL oConditionalFormat,oConditionalFormat1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oConditionalFormat := oG2antt:ConditionalFormats():Add("1","K1") oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oConditionalFormat:ApplyTo := 1/*0x1+*/ oConditionalFormat1 := oG2antt:ConditionalFormats():Add("1","K2") oConditionalFormat1:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oConditionalFormat1:ApplyTo := 2/*0x2+*/ oG2antt:MarkSearchColumn := .F. oG2antt:DrawGridLines := -2/*exRowLines*/ oColumns := oG2antt:Columns() oColumns:Add("Column 1") oColumns:Add("Column 2") oColumns:Add("Column 3") oItems := oG2antt:Items() oItems:AddItem() oItems:AddItem() oItems:AddItem() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1391 |
Is it possible to change the height for all items at once
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:Columns():Add("Items") oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",0,.T.) oG2antt:EndUpdate() oG2antt:DefaultItemHeight := 12 oG2antt:Items():SetProperty("ItemHeight",0,12) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1390 |
Is it possible to include the weekday when displaying the date
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:MarkSearchColumn := .F. oColumns := oG2antt:Columns() oColumns:Add("Tasks") oColumn := oColumns:Add("Start") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1) oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn:FormatColumn := "value + '<font ;6> ' + (weekday(date(value)) case(0:'Sun';1:'Mon';2:'Tue';3:'Wed';4:'Thu';5:'Fri';6:'Sat'))" oColumn1 := oColumns:Add("End") oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2) oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn1:FormatColumn := "value + '<font ;6> ' + (weekday(date(value)) case(0:'Sun';1:'Mon';2:'Tue';3:'Wed';4:'Thu';5:'Fri';6:'Sat'))" oChart := oG2antt:Chart() oChart:FirstVisibleDate := "09/20/2006" oChart:AllowLinkBars := .F. oChart:AllowCreateBar := 0/*exNoCreateBar*/ oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,256) oChart:NonworkingDays := 0 oChart:FirstWeekDay := 1/*exMonday*/ oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. oItems:AddBar(oItems:AddItem("Task 1"),"Task","09/21/2006","09/24/2006") oItems:AddBar(oItems:AddItem("Task 2"),"Task","09/22/2006","09/25/2006") oItems:AddBar(oItems:AddItem("Task 3"),"Task","09/23/2006","09/26/2006") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1389 |
I need my chart to display the end date with on day less. How can I do this (Method 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:MarkSearchColumn := .F. oColumns := oG2antt:Columns() oColumns:Add("Tasks") oColumns:Add("Start"):SetProperty("Def",18/*exCellValueToItemBarProperty*/,1) oColumn := oColumns:Add("End") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2) oColumn:FormatColumn := "shortdate(date(value)-1)" oChart := oG2antt:Chart() oChart:FirstVisibleDate := "09/20/2006" oChart:AllowLinkBars := .F. oChart:AllowCreateBar := 0/*exNoCreateBar*/ oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,196) oChart:NonworkingDays := 0 oItems := oG2antt:Items() oItems:AllowCellValueToItemBar := .T. oItems:AddBar(oItems:AddItem("Task 1"),"Task","09/21/2006","09/24/2006") oItems:AddBar(oItems:AddItem("Task 2"),"Task","09/22/2006","09/25/2006") oItems:AddBar(oItems:AddItem("Task 3"),"Task","09/23/2006","09/26/2006") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1388 |
Is it possible to display my custom time-units
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oChart:FirstVisibleDate := 0 oChart:NonworkingDays := 0 oLevel := oChart:Level(0) oLevel:Unit := 4096/*exDay*/ oLevel:Count := 16 oLevel:Alignment := 1/*CenterAlignment*/ oLevel:Label := "<%i%>" oLevel:FormatLabel := "'Half ' + (1 + (value/16) mod 2)" oLevel1 := oChart:Level(1) oLevel1:Label := "<%i%>" oLevel1:FormatLabel := "1 + value mod 16" oLevel1:SetProperty("ReplaceLabel",Transform(2,""),"<font ;10><B>Y") oChart:AdjustLevelsToBase := .T. oChart:SetProperty("ScrollRange",0/*exStartDate*/,0) oChart:SetProperty("ScrollRange",1/*exEndDate*/,31) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1387 |
Is it possible to add new records and see them in the control's view using the DataSource
PROCEDURE OnAddItem(oG2antt,Item) LOCAL oItems oItems := oG2antt:Items() oItems:SetProperty("SelectItem",Item,.T.) oItems:EnsureVisibleItem(Item) oG2antt:Edit(0) RETURN PROCEDURE OnButtonClick(oG2antt,Item,ColIndex,Key) oG2antt:DataSource():AddNew() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h LOCAL rs oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oG2antt,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/ rs := CreateObject("ADODB.Recordset") rs:Append("Task",8/*adBSTR*/) rs:Append("Start",7/*adDate*/) rs:Append("End",7/*adDate*/) rs:Open() oG2antt:DrawGridLines := -2/*exRowLines*/ oG2antt:DetectAddNew := .T. oG2antt:DetectDelete := .T. oG2antt:DataSource := rs oItems := oG2antt:Items() oItems:SetProperty("LockedItemCount",0/*exTop*/,1) h := oItems:LockedItem(0/*exTop*/,0) oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("ItemHeight",h,22) oItems:SetProperty("CellValue",h,0,"AddNew") oItems:SetProperty("CellHasButton",h,0,.T.) oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1386 |
How can I limit the bars to scrolling range only
PROCEDURE OnCreateBar(oG2antt,Item,DateStart,DateEnd) LOCAL oItems oItems := oG2antt:Items() oItems:SetProperty("ItemBar",Item,"newbar",22/*exBarMinStart*/,oG2antt:Chart():ScrollRange(2/*exMinDate*/)) oItems:SetProperty("ItemBar",Item,"newbar",25/*exBarMaxEnd*/,oG2antt:Chart():ScrollRange(3/*exMaxDate*/)) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CreateBar := {|Item,DateStart,DateEnd| OnCreateBar(oG2antt,Item,DateStart,DateEnd)} /*Fired when the user creates a new bar.*/ oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,56) oChart:SetProperty("ScrollRange",0/*exStartDate*/,"01/01/2001") oChart:SetProperty("ScrollRange",1/*exEndDate*/,"01/15/2001") oChart:FirstVisibleDate := "01/12/2001" oChart:AllowCreateBar := 1/*exCreateBarAuto*/ oItems := oG2antt:Items() oItems:AddItem("Task 1") oItems:AddItem("Task 2") oItems:AddItem("Task 3") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1385 |
How do I get the handle of the last added item
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Def") oItems := oG2antt:Items() oItems:AddItem(1) oItems:AddItem(2) DevOut( Transform(oItems:ItemByIndex(oItems:ItemCount()),"") ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1384 |
How can I set the charts date format to any other international Format then the US version. I would need "dd.mmm.yyyy" instead of "mmm.d.'yy"
|
1383 |
Is it possible to define the bar colors, and have the cumulative histogram showing the same colors
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h,h1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SingleSel := .F. oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:AllowLinkBars := .F. oChart:DrawGridLines := -1/*exAllLines*/ oChart:FirstVisibleDate := "12/24/2000" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:SetProperty("PaneWidth",.F.,128) oChart:HistogramView := 1298/*exHistogramNoGrouping+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramSelectedItems*/ oBar := oChart:Bars:Item("Task") oBar:HistogramType := 256/*exHistCumulative*/ oBar:HistogramItems := 6 oBar:HistogramPattern := oBar:Pattern() oBar:HistogramCumulativeOriginalColorBars := 1/*exKeepOriginalColor*/ oBar:OverlaidType := 1/*exOverlaidBarsOffset*/ oG2antt:Columns():Add("Column") oItems := oG2antt:Items() h := oItems:AddItem("Project") oItems:SetProperty("ItemBold",h,.T.) oItems:SetProperty("SelectableItem",h,.F.) h1 := oItems:InsertItem(h,,"Item 1") oItems:AddBar(h1,"Task","01/02/2001","01/04/2001") h1 := oItems:InsertItem(h,,"Item 2") oItems:AddBar(h1,"Task","01/03/2001","01/05/2001") h1 := oItems:InsertItem(h,,"Item 3") oItems:AddBar(h1,"Task","01/04/2001","01/06/2001") oItems:AddBar(h1,"Task","01/01/2001","01/03/2001","green") oItems:SetProperty("ItemBar",h1,"green",33/*exBarColor*/,65280) oItems:AddBar(h1,"Task","01/08/2001","01/10/2001","red") oItems:SetProperty("ItemBar",h1,"red",33/*exBarColor*/,255) oItems:SetProperty("ExpandItem",h,.T.) oItems:SelectAll() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1382 |
How can I hide the values shown in the legend when cumulative histogram is displayed
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:SetProperty("PaneWidth",.F.,128) oChart:HistogramView := 1300/*exHistogramNoGrouping+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/ oBar := oChart:Bars:Item("Task") oBar:HistogramPattern := 1/*exPatternSolid*/ oBar:HistogramType := 256/*exHistCumulative*/ oBar:HistogramItems := 6 oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,0,0 } ) , .F. )) oBar:SetProperty("HistogramBorderColor",AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. )) oBar:HistogramCumulativeShowLegend := 65535 oBar:HistogramCumulativeOriginalColorBars := 0/*exChangeColor*/ oColumn := oG2antt:Columns():Add("Column") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oItems := oG2antt:Items() h := oItems:AddItem("Project 1") oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/05/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 3"),"Task","01/04/2001","01/06/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 4"),"Task","01/02/2001","01/08/2001") oItems:SetProperty("CellState",oItems:ItemByIndex(1),0,1) oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1381 |
Is it possible to define the bar colors, and have the cumulative histogram showing the same colors
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SetProperty("SelBackColor",oG2antt:BackColor()) oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor()) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:SetProperty("PaneWidth",.F.,128) oChart:HistogramView := 1300/*exHistogramNoGrouping+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/ oBar := oChart:Bars:Item("Task") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oBar:HistogramType := 256/*exHistCumulative*/ oBar:HistogramItems := 6 oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,0,0 } ) , .F. )) oBar:SetProperty("HistogramBorderColor",AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. )) oBar:HistogramCumulativeColors := 2 oBar:SetProperty("HistogramCumulativeColor",0,AutomationTranslateColor( GraMakeRGBColor ( { 0,0,255 } ) , .F. )) oBar:SetProperty("HistogramCumulativeColor",1,AutomationTranslateColor( GraMakeRGBColor ( { 0,0,255 } ) , .F. )) oBar:HistogramCumulativeOriginalColorBars := 0/*exChangeColor*/ oBar:HistogramPattern := oBar:Pattern() oBar:HistogramCumulativeShowLegend := 65535 oColumn := oG2antt:Columns():Add("Column") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oItems := oG2antt:Items() h := oItems:AddItem("Project 1") oItems:AddBar(oItems:InsertItem(h,,"Item 1"),"Task","01/02/2001","01/04/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 2"),"Task","01/03/2001","01/05/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 3"),"Task","01/04/2001","01/06/2001") oItems:AddBar(oItems:InsertItem(h,,"Item 4"),"Task","01/02/2001","01/08/2001") oItems:SetProperty("CellState",oItems:ItemByIndex(1),0,1) oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1380 |
Is it possible to show the non-working pattern over the bars
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar,oBar1 LOCAL oBars LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:NonworkingDaysPattern := 6/*exPatternBDiagonal*/ oChart:SetProperty("NonworkingDaysColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:HistogramView := 2160/*exHistogramBackground+exHistogramAllItems*/ oChart:LevelCount := 2 oBars := oChart:Bars() oBar := oBars:Add("Empty") oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oBar:Pattern := 5/*exPatternFDiagonal*/ oBar:Shape := 17/*exShapeSolidFrameless*/ oBar1 := oBars:Add("Task:Empty") oBar1:Shortcut := "Task" oBar1:HistogramItems := -5 oBar1:HistogramCriticalValue := 3 oBar1:HistogramType := 0/*exHistOverload*/ oBar1:HistogramPattern := oBar1:Pattern() oBar1:SetProperty("Def",3/*exBarCaption*/,"<%=%258%> working days bar") oBar1:SetProperty("Def",4/*exBarHAlignCaption*/,18) oBar1:SetProperty("Def",20/*exBarKeepWorkingCount*/,.T.) oChart:UnitWidthNonworking := -12 oChart:Level(1):FormatLabel := "weekday(dvalue) in (0,6) ? `` : value" oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task A"),"Task","06/23/2005","06/29/2005","") oItems:AddBar(oItems:AddItem("Task B"),"Task","06/24/2005","06/28/2005","") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1379 |
I'm showing values from a ado recordset from sql 2005. When I try to edit a column with integers, it just skips back to the original numbers after pressing enter..., why
PROCEDURE OnAddItem(oG2antt,Item) LOCAL oItems oItems := oG2antt:Items() oItems:AddBar(Item,"Task",oItems:CellValue(Item,2),oItems:CellValue(Item,4)) RETURN PROCEDURE OnError(oG2antt,Error,Description) DevOut( Transform(Error,"") ) DevOut( Transform(Description,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL rs oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:Error := {|Error,Description| OnError(oG2antt,Error,Description)} /*Fired when an internal error occurs.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/03/1994" oChart:SetProperty("PaneWidth",.F.,256) oChart:LevelCount := 2 oChart:UnitScale := 4096/*exDay*/ oChart:FirstWeekDay := 1/*exMonday*/ oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/ oG2antt:ColumnAutoResize := .F. oG2antt:ContinueColumnScroll := .F. rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb",1/*adOpenKeyset*/,1/*adLockReadOnly*/) oG2antt:DataSource := rs oG2antt:Items():AllowCellValueToItemBar := .T. oG2antt:Columns:Item(2):SetProperty("Def",18/*exCellValueToItemBarProperty*/,1) oG2antt:Columns:Item(4):SetProperty("Def",18/*exCellValueToItemBarProperty*/,2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1378 |
Is it possible to reduce the non-working parts of the control
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:HistogramView := 112/*exHistogramAllItems*/ oChart:LevelCount := 2 oBar := oChart:Bars():Item("Task") oBar:HistogramType := 1/*exHistOverAllocation*/ oBar:HistogramPattern := oBar:Pattern() oChart:UnitWidthNonworking := -8 oChart:Level(1):FormatLabel := "weekday(dvalue) in (0,6) ? `` : value" oItems := oG2antt:Items() h := oItems:AddItem("Task A") oItems:AddBar(h,"Task","06/23/2005","06/29/2005","","4 working days bar") oItems:SetProperty("ItemBar",h,"",10/*exBarCanResize*/,.F.) oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,4) oItems:SetProperty("ItemBar",h,"",20/*exBarKeepWorkingCount*/,.T.) h := oItems:AddItem("Task B") oItems:AddBar(h,"Task","06/28/2005","06/30/2005","","2 working days bar") oItems:SetProperty("ItemBar",h,"",10/*exBarCanResize*/,.F.) oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,2) oItems:SetProperty("ItemBar",h,"",20/*exBarKeepWorkingCount*/,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1377 |
I don't want to see the "schedule"/show "workload" in non-working days part of the histogram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:HistogramView := 112/*exHistogramAllItems*/ oChart:LevelCount := 2 oBar := oChart:Bars():Item("Task") oBar:HistogramType := 1/*exHistOverAllocation*/ oBar:HistogramPattern := oBar:Pattern() oChart:ShowNonworkingDates := .F. oChart:ShowNonworkingUnits := .F. oItems := oG2antt:Items() h := oItems:AddItem("Task A") oItems:AddBar(h,"Task","06/23/2005","06/29/2005","","4 working days bar") oItems:SetProperty("ItemBar",h,"",10/*exBarCanResize*/,.F.) oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,4) oItems:SetProperty("ItemBar",h,"",20/*exBarKeepWorkingCount*/,.T.) h := oItems:AddItem("Task B") oItems:AddBar(h,"Task","06/28/2005","06/30/2005","","2 working days bar") oItems:SetProperty("ItemBar",h,"",10/*exBarCanResize*/,.F.) oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,2) oItems:SetProperty("ItemBar",h,"",20/*exBarKeepWorkingCount*/,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1376 |
The control shows, and handles non-working days PERFECT, but how is it possible to reflect this in the Histogram. I don't want to "schedule"/show "workload" in non-working days...
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,40) oChart:FirstVisibleDate := "06/20/2005" oChart:HistogramVisible := .T. oChart:HistogramHeight := 64 oChart:HistogramView := 112/*exHistogramAllItems*/ oChart:LevelCount := 2 oBar := oChart:Bars():Item("Task") oBar:HistogramType := 1/*exHistOverAllocation*/ oBar:HistogramPattern := oBar:Pattern() oItems := oG2antt:Items() h := oItems:AddItem("Task A") oItems:AddBar(h,"Task","06/23/2005","06/29/2005","","4 working days bar") oItems:SetProperty("ItemBar",h,"",10/*exBarCanResize*/,.F.) oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,4) oItems:SetProperty("ItemBar",h,"",20/*exBarKeepWorkingCount*/,.T.) h := oItems:AddItem("Task B") oItems:AddBar(h,"Task","06/28/2005","06/30/2005","","2 working days bar") oItems:SetProperty("ItemBar",h,"",10/*exBarCanResize*/,.F.) oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,2) oItems:SetProperty("ItemBar",h,"",20/*exBarKeepWorkingCount*/,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1375 |
When I do select the button in the overview-zoom I want the scaling to change accordingly. Can I set different scales per selected zoom level
PROCEDURE OnOverviewZoom(oG2antt) DevOut( Transform(oG2antt:Chart:UnitScale(),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:OverviewZoom := {|| OnOverviewZoom(oG2antt)} /*Occurs once the user selects a new time scale unit in the overview zoom area.*/ oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/ oChart:AllowOverviewZoom := 1/*exAlwaysZoom*/ oChart:SetProperty("Label",16777216/*exSecond*/,"") oChart:SetProperty("Label",0/*exYear*/,"") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1374 |
How do I display Icons instead of text in the overview zoom area
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=") oChart := oG2antt:Chart() oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/ oChart:AllowOverviewZoom := 1/*exAlwaysZoom*/ oChart:SetProperty("Label",16777216/*exSecond*/,"") oChart:SetProperty("Label",0/*exYear*/,"") DevOut( oChart:OverviewZoomCaption() ) oChart:OverviewZoomCaption := "Year|½Year|¼Year|Month|Third|<img>1</img>|Day|Hour|Min|Sec" oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1373 |
How do I get it to only display Min, Hour, Day, Week , Month, ie remove Sec and Year in the overview area
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/ oChart:AllowOverviewZoom := 1/*exAlwaysZoom*/ oChart:SetProperty("Label",16777216/*exSecond*/,"") oChart:SetProperty("Label",0/*exYear*/,"") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1372 |
Is it possible to show quarter hours markers
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oG2antt:VisualAppearance():Add(3,"gBFLBCJwBAEHhEJAEGg4BdMIQAAYAQGKIYBkAKBQAGaAoDDUNw5QwAAwjSKkEwsACEIrjKCRShyCYZRhGcTAFBMIhkGoSZKlCIRVDCKYJDbKACSFKkNQ7AabZBgOQJVgOKovThKcIybQAASJCKRY7nUIIJA+SoDSRAbqhYIgASnKqLJAkACIJJAaRjHQdJxGKKMQANBghCZseKhWgkKIJUxAdLTWAAMQuaCoZ5icRAca2fJ+XzfeBYDgmAYNQbDcJhHCMMwXDaJZBiGJ4dimI4rR7JIDzDJ8cxbEKTZ5meg5boGRZNTrMQA0fQ9MynK6vahfOi7DpuaZnWrcMb2fYNZwrGq0bxoW58BwmP5/XrkNa4XgcVgmAUBA") oG2antt:HeaderHeight := 20 oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oChart:UnitScale := 65536/*exHour*/ oLevel := oChart:Level(0) oLevel:Alignment := 16/*exHOutside*/ oLevel:Label := "<%dddd%>, <%mmmm%> <b><%d%></b>, <%yyyy%>" oLevel:DrawTickLines := 2/*exLevelSolidLine*/ oLevel1 := oChart:Level(1) oLevel1:Label := "<%hh%>:00" oLevel1:SetProperty("BackColor",0x3000000) oLevel1:DrawTickLines := 2/*exLevelSolidLine*/ oChart:DrawLevelSeparator := 2/*exLevelSolidLine*/ oChart:UnitWidth := 64 oChart:ResizeUnitScale := 1048576/*exMinute*/ oChart:ResizeUnitCount := 15 oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1371 |
How can I ensure or always show the labels on the chart part, when scrolling the chart to left or right
|
1370 |
I associate the Start and End columns with bars, but some of them are not shown. What am I doing wrong
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:MarkSearchColumn := .F. oG2antt:Items():AllowCellValueToItemBar := .T. oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "12/25/2000" oChart:SetProperty("PaneWidth",.F.,128) oColumn := oG2antt:Columns():Add("Start") oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1) oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"K1") oColumn1 := oG2antt:Columns():Add("End") oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2) oColumn1:SetProperty("Def",19/*exCellValueToItemBarKey*/,"K1") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem(),"Task","01/01/2001","01/05/2001","K1") oItems:AddBar(oItems:AddItem(),"Task","01/02/2001","01/06/2001","K1") oItems:AddBar(oItems:AddItem(),"Task","01/03/2001","01/07/2001","????","????") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1369 |
How can I implement OLE Drag and Drop operation
PROCEDURE OnOLEStartDrag(oG2antt,Data,AllowedEffects) /*Data.SetData("your data to drag")*/ AllowedEffects := 2 RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:OLEStartDrag := {|Data,AllowedEffects| OnOLEStartDrag(oG2antt,Data,AllowedEffects)} /*Occurs when the OLEDrag method is called.*/ oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:Columns():Add("Default") oItems := oG2antt:Items() oItems:AddItem("Item 1") oItems:AddItem("Item 2") oItems:AddItem("Item 3") oItems:AddItem("Item 4") oItems:AddItem("Item 5") oG2antt:OLEDropMode := 1/*exOLEDropManual*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1368 |
I can not associate the bar's start and end properties with my start/end columns, only if the bar's key is empty or null. What can I do
PROCEDURE OnButtonClick(oG2antt,Item,ColIndex,Key) LOCAL oColumns LOCAL oItems oG2antt:BeginUpdate() oColumns := oG2antt:Columns() oColumns:Item("Tasks"):SetProperty("Def",19/*exCellValueToItemBarKey*/,"B") oColumns:Item("Start"):SetProperty("Def",19/*exCellValueToItemBarKey*/,"B") oColumns:Item("End"):SetProperty("Def",19/*exCellValueToItemBarKey*/,"B") oItems := oG2antt:Items() oItems:SetProperty("CellValue",Item,1,"B") oItems:SetProperty("ItemBar",0,"B",33/*exBarColor*/,0) oItems:SetProperty("ItemBar",0,"A",33/*exBarColor*/,16775408) oG2antt:EndUpdate() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oColumn,oColumn1,oColumn2 LOCAL oColumns LOCAL oItems,oItems1 LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oG2antt,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/ oG2antt:BeginUpdate() oColumns := oG2antt:Columns() oColumn := oColumns:Add("Tasks") oColumn:Width := 32 oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,3) oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"A") oColumn1 := oColumns:Add("Start") oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1) oColumn1:SetProperty("Def",19/*exCellValueToItemBarKey*/,"A") oColumn1:Editor():EditType := 7/*DateType*/ oColumn2 := oColumns:Add("End") oColumn2:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2) oColumn2:SetProperty("Def",19/*exCellValueToItemBarKey*/,"A") oColumn2:Editor():EditType := 7/*DateType*/ oChart := oG2antt:Chart() oChart:FirstVisibleDate := "09/20/2006" oChart:AllowLinkBars := .T. oChart:AllowCreateBar := 0/*exNoCreateBar*/ oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,196) oBar := oChart:Bars:Item("Task") oBar:Pattern := 6/*exPatternBDiagonal*/ oBar:OverlaidType := 515/*exOverlaidBarsStackAutoArrange+exOverlaidBarsStack*/ oBar:SetProperty("Overlaid",256/*exOverlaidBarsTransparent*/,80) oItems := oG2antt:Items() oItems:SetProperty("LockedItemCount",0/*exTop*/,1) h := oItems:LockedItem(0/*exTop*/,0) oItems:SetProperty("CellValue",h,0,"Select") oItems:SetProperty("CellHasButton",h,0,.T.) oItems:SetProperty("CellMerge",h,1,2) oItems:SetProperty("CellValue",h,1,"A") oItems:CellEditor(h,1):EditType := 1/*EditType*/ oItems1 := oG2antt:Items() oItems1:AllowCellValueToItemBar := .T. h := oItems1:AddItem("Task 1") oItems1:AddBar(h,"Task","09/21/2006","09/24/2006","A","A") oItems1:AddBar(h,"Task","09/25/2006","09/28/2006","B","B") oItems1:SetProperty("ItemBar",h,"B",33/*exBarColor*/,16775408) h := oItems1:AddItem("Task 2") oItems1:AddBar(h,"Task","09/22/2006","09/25/2006","A","A") oItems1:AddBar(h,"Task","09/26/2006","09/29/2006","B","B") oItems1:SetProperty("ItemBar",h,"B",33/*exBarColor*/,16775408) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1367 |
How can I determine the order of the events
PROCEDURE OnAddLink(oG2antt,LinkKey) DevOut( "AddLink" ) DevOut( Transform(LinkKey,"") ) RETURN PROCEDURE OnAfterExpandItem(oG2antt,Item) DevOut( "AfterExpandItem" ) DevOut( Transform(Item,"") ) RETURN PROCEDURE OnAllowLink(oG2antt,StartItem,StartBarKey,EndItem,EndBarKey,LinkKey,Cancel) DevOut( "AllowLink" ) DevOut( Transform(StartItem,"") ) DevOut( Transform(StartBarKey,"") ) DevOut( Transform(EndItem,"") ) DevOut( Transform(EndBarKey,"") ) DevOut( Transform(LinkKey,"") ) RETURN PROCEDURE OnAnchorClick(oG2antt,AnchorID,Options) DevOut( "AnchorClick" ) DevOut( Transform(AnchorID,"") ) DevOut( Transform(Options,"") ) RETURN PROCEDURE OnBarParentChange(oG2antt,Item,Key,NewItem,Cancel) DevOut( "BarParentChange" ) DevOut( Transform(Item,"") ) DevOut( Transform(Key,"") ) DevOut( Transform(NewItem,"") ) RETURN PROCEDURE OnBarResize(oG2antt,Item,Key) DevOut( "BarResize" ) DevOut( Transform(Item,"") ) DevOut( Transform(Key,"") ) RETURN PROCEDURE OnBarResizing(oG2antt,Item,Key) DevOut( "BarResizing" ) DevOut( Transform(Item,"") ) DevOut( Transform(Key,"") ) RETURN PROCEDURE OnBeforeExpandItem(oG2antt,Item,Cancel) DevOut( "BeforeExpandItem" ) DevOut( Transform(Item,"") ) RETURN PROCEDURE OnButtonClick(oG2antt,Item,ColIndex,Key) DevOut( "ButtonClick" ) DevOut( Transform(Item,"") ) DevOut( Transform(ColIndex,"") ) DevOut( Transform(Key,"") ) RETURN PROCEDURE OnCellImageClick(oG2antt,Item,ColIndex) DevOut( "CellImageClick" ) DevOut( Transform(Item,"") ) DevOut( Transform(ColIndex,"") ) RETURN PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) DevOut( "CellStateChanged" ) DevOut( Transform(Item,"") ) DevOut( Transform(ColIndex,"") ) RETURN PROCEDURE OnChange(oG2antt,Item,ColIndex,NewValue) DevOut( "Change" ) DevOut( Transform(Item,"") ) DevOut( Transform(ColIndex,"") ) DevOut( Transform(NewValue,"") ) RETURN PROCEDURE OnChartEndChanging(oG2antt,Operation) DevOut( "ChartEndChanging" ) DevOut( Transform(Operation,"") ) RETURN PROCEDURE OnChartSelectionChanged(oG2antt) DevOut( "ChartSelectionChanged" ) RETURN PROCEDURE OnChartStartChanging(oG2antt,Operation) DevOut( "ChartStartChanging" ) DevOut( Transform(Operation,"") ) RETURN PROCEDURE OnClick(oG2antt) DevOut( "Click" ) RETURN PROCEDURE OnColumnClick(oG2antt,Column) DevOut( "ColumnClick" ) RETURN PROCEDURE OnCreateBar(oG2antt,Item,DateStart,DateEnd) DevOut( "CreateBar" ) DevOut( Transform(Item,"") ) DevOut( Transform(DateStart,"") ) DevOut( Transform(DateEnd,"") ) RETURN PROCEDURE OnDateChange(oG2antt) DevOut( "DateChange" ) RETURN PROCEDURE OnDblClick(oG2antt,Shift,X,Y) DevOut( "DblClick" ) DevOut( Transform(Shift,"") ) DevOut( Transform(X,"") ) DevOut( Transform(Y,"") ) oG2antt:Edit() RETURN PROCEDURE OnEdit(oG2antt,Item,ColIndex,Cancel) DevOut( "Edit" ) DevOut( Transform(Item,"") ) DevOut( Transform(ColIndex,"") ) RETURN PROCEDURE OnEditClose(oG2antt) DevOut( "EditClose" ) RETURN PROCEDURE OnEditOpen(oG2antt) DevOut( "EditOpen" ) RETURN PROCEDURE OnFilterChange(oG2antt) DevOut( "FilterChange" ) RETURN PROCEDURE OnFilterChanging(oG2antt) DevOut( "FilterChanging" ) RETURN PROCEDURE OnFocusChanged(oG2antt) DevOut( "FocusChanged" ) RETURN PROCEDURE OnInsideZoom(oG2antt,DateTime) DevOut( "InsideZoom" ) DevOut( Transform(DateTime,"") ) RETURN PROCEDURE OnKeyDown(oG2antt,KeyCode,Shift) DevOut( "KeyDown" ) DevOut( Transform(KeyCode,"") ) DevOut( Transform(Shift,"") ) RETURN PROCEDURE OnKeyPress(oG2antt,KeyAscii) DevOut( "KeyPress" ) DevOut( Transform(KeyAscii,"") ) RETURN PROCEDURE OnKeyUp(oG2antt,KeyCode,Shift) DevOut( "KeyUp" ) DevOut( Transform(KeyCode,"") ) DevOut( Transform(Shift,"") ) RETURN PROCEDURE OnLayoutChanged(oG2antt) DevOut( "LayoutChanged" ) RETURN PROCEDURE OnMouseDown(oG2antt,Button,Shift,X,Y) DevOut( "MouseDown" ) DevOut( Transform(Button,"") ) DevOut( Transform(Shift,"") ) DevOut( Transform(X,"") ) DevOut( Transform(Y,"") ) RETURN PROCEDURE OnMouseMove(oG2antt,Button,Shift,X,Y) RETURN PROCEDURE OnMouseUp(oG2antt,Button,Shift,X,Y) DevOut( "MouseUp" ) DevOut( Transform(Button,"") ) DevOut( Transform(Shift,"") ) DevOut( Transform(X,"") ) DevOut( Transform(Y,"") ) RETURN PROCEDURE OnOffsetChanged(oG2antt,Horizontal,NewVal) DevOut( "OffsetChanged" ) DevOut( Transform(Horizontal,"") ) DevOut( Transform(NewVal,"") ) RETURN PROCEDURE OnOversizeChanged(oG2antt,Horizontal,NewVal) DevOut( "OversizeChanged" ) DevOut( Transform(Horizontal,"") ) DevOut( Transform(NewVal,"") ) RETURN PROCEDURE OnOverviewZoom(oG2antt) DevOut( "OverviewZoom" ) RETURN PROCEDURE OnRClick(oG2antt) DevOut( "RClick" ) RETURN PROCEDURE OnScrollButtonClick(oG2antt,ScrollBar,ScrollPart) DevOut( "ScrollButtonClick" ) DevOut( Transform(ScrollBar,"") ) DevOut( Transform(ScrollPart,"") ) RETURN PROCEDURE OnSelectionChanged(oG2antt) DevOut( "SelectionChanged" ) RETURN PROCEDURE OnSort(oG2antt) DevOut( "Sort" ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumn,oColumn1 LOCAL oColumns LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddLink := {|LinkKey| OnAddLink(oG2antt,LinkKey)} /*Occurs when the user links two bars using the mouse.*/ oG2antt:AfterExpandItem := {|Item| OnAfterExpandItem(oG2antt,Item)} /*Fired after an item is expanded (collapsed).*/ oG2antt:AllowLink := {|StartItem,StartBarKey,EndItem,EndBarKey,LinkKey,Cancel| OnAllowLink(oG2antt,StartItem,StartBarKey,EndItem,EndBarKey,LinkKey,Cancel)} /*Notifies at runtime when a link between two bars is possible.*/ oG2antt:AnchorClick := {|AnchorID,Options| OnAnchorClick(oG2antt,AnchorID,Options)} /*Occurs when an anchor element is clicked.*/ oG2antt:BarParentChange := {|Item,Key,NewItem,Cancel| OnBarParentChange(oG2antt,Item,Key,NewItem,Cancel)} /*Occurs just before moving a bar from current item to another item.*/ oG2antt:BarResize := {|Item,Key| OnBarResize(oG2antt,Item,Key)} /*Occurs when a bar is moved or resized.*/ oG2antt:BarResizing := {|Item,Key| OnBarResizing(oG2antt,Item,Key)} /*Occurs when a bar is moving or resizing.*/ oG2antt:BeforeExpandItem := {|Item,Cancel| OnBeforeExpandItem(oG2antt,Item,Cancel)} /*Fired before an item is about to be expanded (collapsed).*/ oG2antt:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oG2antt,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/ oG2antt:CellImageClick := {|Item,ColIndex| OnCellImageClick(oG2antt,Item,ColIndex)} /*Fired after the user clicks on the image's cell area.*/ oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:Change := {|Item,ColIndex,NewValue| OnChange(oG2antt,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/ oG2antt:ChartEndChanging := {|Operation| OnChartEndChanging(oG2antt,Operation)} /*Occurs after the chart has been changed.*/ oG2antt:ChartSelectionChanged := {|| OnChartSelectionChanged(oG2antt)} /*Occurs when the user selects objects in the chart area.*/ oG2antt:ChartStartChanging := {|Operation| OnChartStartChanging(oG2antt,Operation)} /*Occurs when the chart is about to be changed.*/ oG2antt:Click := {|| OnClick(oG2antt)} /*Occurs when the user presses and then releases the left mouse button over the tree control.*/ oG2antt:ColumnClick := {|Column| OnColumnClick(oG2antt,Column)} /*Fired after the user clicks on column's header.*/ oG2antt:CreateBar := {|Item,DateStart,DateEnd| OnCreateBar(oG2antt,Item,DateStart,DateEnd)} /*Fired when the user creates a new bar.*/ oG2antt:DateChange := {|| OnDateChange(oG2antt)} /*Occurs when the first visible date is changed.*/ oG2antt:DblClick := {|Shift,X,Y| OnDblClick(oG2antt,Shift,X,Y)} /*Occurs when the user dblclk the left mouse button over an object.*/ oG2antt:Edit := {|Item,ColIndex,Cancel| OnEdit(oG2antt,Item,ColIndex,Cancel)} /*Occurs just before editing the focused cell.*/ oG2antt:EditClose := {|| OnEditClose(oG2antt)} /*Occurs when the edit operation ends.*/ oG2antt:EditOpen := {|| OnEditOpen(oG2antt)} /*Occurs when the edit operation starts.*/ oG2antt:FilterChange := {|| OnFilterChange(oG2antt)} /*Occurs when the filter was changed.*/ oG2antt:FilterChanging := {|| OnFilterChanging(oG2antt)} /*Notifies your application that the filter is about to change.*/ oG2antt:FocusChanged := {|| OnFocusChanged(oG2antt)} /*Occurs when a cell gets the focus.*/ oG2antt:InsideZoom := {|DateTime| OnInsideZoom(oG2antt,DateTime)} /*Notifies your application that a date is about to be magnified.*/ oG2antt:KeyDown := {|KeyCode,Shift| OnKeyDown(oG2antt,KeyCode,Shift)} /*Occurs when the user presses a key while an object has the focus.*/ oG2antt:KeyPress := {|KeyAscii| OnKeyPress(oG2antt,KeyAscii)} /*Occurs when the user presses and releases an ANSI key.*/ oG2antt:KeyUp := {|KeyCode,Shift| OnKeyUp(oG2antt,KeyCode,Shift)} /*Occurs when the user releases a key while an object has the focus.*/ oG2antt:LayoutChanged := {|| OnLayoutChanged(oG2antt)} /*Occurs when column's position or column's size is changed.*/ oG2antt:MouseDown := {|Button,Shift,X,Y| OnMouseDown(oG2antt,Button,Shift,X,Y)} /*Occurs when the user presses a mouse button.*/ oG2antt:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oG2antt,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oG2antt:MouseUp := {|Button,Shift,X,Y| OnMouseUp(oG2antt,Button,Shift,X,Y)} /*Occurs when the user releases a mouse button.*/ oG2antt:OffsetChanged := {|Horizontal,NewVal| OnOffsetChanged(oG2antt,Horizontal,NewVal)} /*Occurs when the scroll position has been changed.*/ oG2antt:OversizeChanged := {|Horizontal,NewVal| OnOversizeChanged(oG2antt,Horizontal,NewVal)} /*Occurs when the right range of the scroll has been changed.*/ oG2antt:OverviewZoom := {|| OnOverviewZoom(oG2antt)} /*Occurs once the user selects a new time scale unit in the overview zoom area.*/ oG2antt:RClick := {|| OnRClick(oG2antt)} /*Fired when right mouse button is clicked*/ oG2antt:ScrollButtonClick := {|ScrollBar,ScrollPart| OnScrollButtonClick(oG2antt,ScrollBar,ScrollPart)} /*Occurs when the user clicks a button in the scrollbar.*/ oG2antt:SelectionChanged := {|| OnSelectionChanged(oG2antt)} /*Fired after a new item has been selected.*/ oG2antt:Sort := {|| OnSort(oG2antt)} /*Fired when the control sorts a column.*/ oG2antt:BeginUpdate() oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=") oG2antt:DrawGridLines := -1/*exAllLines*/ oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:GridLineStyle := 4/*exGridLinesHDash*/ oG2antt:AutoEdit := .F. oG2antt:ExpandOnDblClick := .F. oChart := oG2antt:Chart() oChart:AllowInsideZoom := .T. oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/ oChart:AllowOverviewZoom := 1/*exAlwaysZoom*/ oChart:SetProperty("PaneWidth",.F.,128) oChart:FirstVisibleDate := "01/01/2001" oChart:DrawGridLines := -1/*exAllLines*/ oChart:GridLineStyle := 36/*exGridLinesVSolid+exGridLinesHDash*/ oChart:LevelCount := 2 oChart:Level(0):DrawGridLines := .T. oChart:Bars:Item("Task"):Pattern := 1/*exPatternSolid*/ oChart:UnitScale := 4096/*exDay*/ oChart:SetProperty("Label",16777216/*exSecond*/,"") oChart:SetProperty("Label",1048576/*exMinute*/,"") oChart:SetProperty("Label",65536/*exHour*/,"") oColumns := oG2antt:Columns() oColumn := oColumns:Add("Column") oColumn:DisplayFilterButton := .T. oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:Editor():EditType := 1/*EditType*/ oColumn1 := oColumns:Add("Button") oColumn1:AllowSizing := .F. oColumn1:Width := 18 oColumn1:SetProperty("Def",2/*exCellHasButton*/,.T.) oItems := oG2antt:Items() h := oItems:AddItem("parent") oItems:SetProperty("CellImage",h,0,1) oItems:AddBar(h,"Task","01/02/2001","01/05/2001","A","<a>A</a>") oItems:SetProperty("ItemBar",h,"A",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"A",28/*exBarCanMoveToAnother*/,.T.) oItems:SetProperty("ItemBar",h,"A",6/*exBarToolTip*/,"This is a bit of text that should be shown when cursor hovers the bar") oItems:AddBar(h,"Task","01/08/2001","01/15/2001","B","<a>B</a>") oItems:SetProperty("ItemBar",h,"B",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"B",28/*exBarCanMoveToAnother*/,.T.) oItems:InsertItem(h,"","child") oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1366 |
How can I change the chart's horizontal grid lines
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:DrawGridLines := -1/*exAllLines*/ oG2antt:GridLineStyle := 4/*exGridLinesHDash*/ oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,48) oChart:FirstVisibleDate := "01/01/2001" oChart:DrawGridLines := -1/*exAllLines*/ oChart:GridLineStyle := 36/*exGridLinesVSolid+exGridLinesHDash*/ oChart:LevelCount := 2 oChart:Level(0):DrawGridLines := .T. oChart:Bars:Item("Task"):Pattern := 1/*exPatternSolid*/ oG2antt:Columns():Add("Column") oItems := oG2antt:Items() h := oItems:AddItem("Item 1") oItems:AddBar(h,"Task","01/02/2001","01/05/2001","A") oItems:AddBar(h,"Task","01/08/2001","01/15/2001","B") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1365 |
Is there any way to determine whether the ADO operations fails
PROCEDURE OnAddItem(oG2antt,Item) LOCAL oItems oItems := oG2antt:Items() oItems:AddBar(Item,"Task",oItems:CellValue(Item,2),oItems:CellValue(Item,4)) RETURN PROCEDURE OnError(oG2antt,Error,Description) DevOut( Transform(Error,"") ) DevOut( Transform(Description,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL rs oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:Error := {|Error,Description| OnError(oG2antt,Error,Description)} /*Fired when an internal error occurs.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/03/1994" oChart:SetProperty("PaneWidth",.F.,256) oChart:LevelCount := 2 oChart:UnitScale := 4096/*exDay*/ oChart:FirstWeekDay := 1/*exMonday*/ oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/ oG2antt:ColumnAutoResize := .F. oG2antt:ContinueColumnScroll := .F. rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb",1/*adOpenKeyset*/,1/*adLockReadOnly*/) oG2antt:DataSource := rs oG2antt:Items():AllowCellValueToItemBar := .T. oG2antt:Columns:Item(2):SetProperty("Def",18/*exCellValueToItemBarProperty*/,1) oG2antt:Columns:Item(4):SetProperty("Def",18/*exCellValueToItemBarProperty*/,2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1364 |
Is it possible to select a column instead sorting it
PROCEDURE OnColumnClick(oG2antt,Column) /*Column.Selected = True*/ oG2antt:BeginUpdate() oG2antt:Columns:Item(0):Selected := .F. oG2antt:Columns:Item(1):Selected := .F. oG2antt:Items():SelectAll() oG2antt:EndUpdate() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:ColumnClick := {|Column| OnColumnClick(oG2antt,Column)} /*Fired after the user clicks on column's header.*/ oG2antt:BeginUpdate() oG2antt:MarkSearchColumn := .F. oG2antt:ShowFocusRect := .F. oG2antt:SingleSel := .F. oG2antt:FullRowSelect := 1/*exRectSel*/ oG2antt:SortOnClick := 0/*exNoSort*/ oColumns := oG2antt:Columns() oColumns:Add("Column1") oColumns:Add("Column2") oItems := oG2antt:Items() oItems:SetProperty("CellValue",oItems:AddItem("One"),1,"Three") oItems:SetProperty("CellValue",oItems:AddItem("Two"),1,"Four") oItems:SelectAll() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1363 |
I am using the exRectSel, and clicking the first column, has no effect, instead if I click other it works as it should
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SearchColumnIndex := -1 oG2antt:FullRowSelect := 1/*exRectSel*/ oG2antt:ShowFocusRect := .F. oG2antt:MarkSearchColumn := .F. oColumns := oG2antt:Columns() oColumns:Add("Column1") oColumns:Add("Column2") oItems := oG2antt:Items() oItems:SetProperty("CellValue",oItems:AddItem(1),1,2) oItems:SetProperty("CellValue",oItems:AddItem(3),1,4) oItems:SetProperty("CellValue",oItems:AddItem(5),1,6) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1362 |
Is it possible to display empty strings for 0 values
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oEditor LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oColumn := oG2antt:Columns():Add("Currency") oColumn:FormatColumn := "dbl(value) ? currency(dbl(value)) : ``" oEditor := oColumn:Editor() oEditor:EditType := 1/*EditType*/ oEditor:Numeric := 1/*exFloat*/ oItems := oG2antt:Items() oItems:AddItem(1.23) oItems:AddItem(2.34) oItems:AddItem(0) oItems:AddItem(10000.99) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1361 |
Is it possible to display empty strings for 0 values
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Number") oG2antt:Columns():Add("Currency"):ComputedField := "%0 ? currency(%0) : ``" oItems := oG2antt:Items() oItems:AddItem(1.23) oItems:AddItem(2.34) oItems:AddItem(0) oItems:AddItem(10000.99) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1360 |
How can I hide a date from the chart view, when I display hours instead days
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oInsideZooms,oInsideZooms1 LOCAL oLevel,oLevel1 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:HeaderHeight := 32 oChart := oG2antt:Chart() oChart:FirstVisibleDate := "06/08/2011" oChart:AdjustLevelsToBase := .T. oChart:SetProperty("PaneWidth",.F.,0) oChart:LevelCount := 2 oChart:AllowInsideZoom := .T. oLevel := oChart:Level(0) oLevel:Alignment := 1/*CenterAlignment*/ oLevel:Label := "<b><%d%>-<%mmm%>-<%yyyy%>" oLevel:Unit := 4096/*exDay*/ oLevel1 := oChart:Level(1) oLevel1:Label := "<%h%>" oLevel1:Count := 8 oLevel1:Unit := 65536/*exHour*/ oLevel1:FormatLabel := "date(int(dvalue)) case (#06/08/2011# : (int(value) case ( 0 : 'Shift <b>1</b><br>23/20'; 8 : 'Shift <b>2</b><br>38/30' ; 16 : 'Shift <b>3</b><br>24/24' ) ) ; #06/09/2011# : (int(value) case ( 0 : 'Shift <b>1</b><br>15/20'; 8 : 'Shift <b>2</b><br>30/32' ; 16 : 'Shift <b>3</b><br>26/24' ) ) )" oChart:UnitWidth := 64 oChart:NonworkingDays := 0 oChart:AllowInsideZoom := .T. oChart:DefaultInsideZoomFormat():InsideUnit := 1048576/*exMinute*/ oChart:AllowResizeInsideZoom := .F. oChart:InsideZoomOnDblClick := .F. oInsideZooms := oChart:InsideZooms() oInsideZooms:SplitBaseLevel := .F. oInsideZooms:DefaultWidth := 0 oInsideZooms1 := oChart:InsideZooms() oInsideZooms1:Add("06/09/2011 08:00:00") oInsideZooms1:Add("06/09/2011 16:00:00") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1359 |
I’ve created a skin (EBN) for the bars of my chart, with rounded top corners. The problem, is that these rounded corners are applied also at beginning and the end of the non working units. Is it possible to show a different picture/skin for the non-working part of the bars
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBars LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn") oG2antt:VisualAppearance():Add(2,"c:\exontrol\images\pushed.ebn") oG2antt:Columns():Add("Task") oG2antt:Chart():SetProperty("PaneWidth",.F.,128) oBars := oG2antt:Chart():Bars() oBars:Item("Task"):SetProperty("Color",0x1000000) oBars:Item("Split"):SetProperty("Color",0x2000000) oBars:Add("Task:Split"):Shortcut := "TS" oG2antt:Chart():FirstVisibleDate := "01/01/2001" oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task"),"TS","01/02/2001","01/16/2001") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1358 |
How do I display the names of the tasks on bars but not in the middle of the bar (left or right)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "12/27/2000" oChart:SetProperty("PaneWidth",.F.,128) oBar := oChart:Bars:Item("Task") oBar:Pattern := 2/*exPatternDot*/ oBar:Height := 15 oItems := oG2antt:Items() h := oItems:AddItem("Task 1") oItems:AddBar(h,"Task","01/03/2001","01/08/2001","K1","<b>to do</b> ") oItems:SetProperty("ItemBar",h,"K1",4/*exBarHAlignCaption*/,2) h := oItems:AddItem("Task 2") oItems:AddBar(h,"Task","01/03/2001","01/08/2001","K2","<b>to do</b>") oItems:SetProperty("ItemBar",h,"K2",4/*exBarHAlignCaption*/,18) h := oItems:AddItem("Task 3") oItems:AddBar(h,"Task","01/03/2001","01/08/2001","K1"," <b>to do</b>") oItems:SetProperty("ItemBar",h,"K1",4/*exBarHAlignCaption*/,0) h := oItems:AddItem("Task 4") oItems:AddBar(h,"Task","01/03/2001","01/08/2001","K2","<b>to do</b>") oItems:SetProperty("ItemBar",h,"K2",4/*exBarHAlignCaption*/,16) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1357 |
How can I get the list of items as they are displayed
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oG2antt:Columns():Add("Names") oItems := oG2antt:Items() oItems:AddItem("Mantel") oItems:AddItem("Mechanik") oItems:AddItem("Motor") oItems:AddItem("Murks") oItems:AddItem("Märchen") oItems:AddItem("Möhren") oItems:AddItem("Mühle") oG2antt:Columns:Item(0):SortOrder := 1/*SortAscending*/ oG2antt:EndUpdate() DevOut( Transform(oG2antt:GetItems(1),"") ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1356 |
How can I disable the left and right arrows to move to next cell while editing
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL var_Editor LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) var_Editor := oG2antt:Columns:Add("Edit"):Editor() var_Editor:EditType := 1/*EditType*/ var_Editor:SetProperty("Option",20/*exLeftArrow*/,0) var_Editor:SetProperty("Option",21/*exRightArrow*/,0) oItems := oG2antt:Items() oItems:AddItem("Cell 1") oItems:AddItem("Cell 2") oItems:AddItem("Cell 3") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1355 |
Is it possible to define a bar that is treated as a non-working hour so user can move it at runtime
|
1354 |
Is it possible to customize the chart's header so I can display shift and other values
|
1353 |
How can I change both start and end dates of the bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Tasks") oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,64) oChart:FirstVisibleDate := "06/19/2005" oItems := oG2antt:Items() h := oItems:AddItem("Test") oItems:AddBar(h,"Task","06/22/2005","06/27/2005","t1") oItems:AddBar(h,oItems:ItemBar(h,"t1",0/*exBarName*/),"06/21/2005","06/22/2005","t1") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1352 |
Is it possible to add new rows, as I type like in Excel
PROCEDURE OnEditClose(oG2antt) oG2antt:Items():AddItem("") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:EditClose := {|| OnEditClose(oG2antt)} /*Occurs when the edit operation ends.*/ oG2antt:BeginUpdate() oG2antt:AutoEdit := .T. oG2antt:Columns():Add("Default"):Editor():EditType := 1/*EditType*/ oG2antt:FullRowSelect := 0/*exColumnSel*/ oG2antt:Items():AddItem("") oG2antt:DrawGridLines := -1/*exAllLines*/ oG2antt:ScrollBars := 15/*exDisableBoth*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1351 |
How do I load bars from my table/database
PROCEDURE OnAddItem(oG2antt,Item) LOCAL oItems oItems := oG2antt:Items() oItems:AddBar(Item,"Task",oItems:CellValue(Item,2),oItems:CellValue(Item,4)) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL rs oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:FirstVisibleDate := "08/03/1994" oChart:SetProperty("PaneWidth",.F.,256) oChart:LevelCount := 2 oChart:UnitScale := 4096/*exDay*/ oChart:FirstWeekDay := 1/*exMonday*/ oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/ oG2antt:ColumnAutoResize := .F. oG2antt:ContinueColumnScroll := .F. rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/) oG2antt:DataSource := rs oG2antt:Items():AllowCellValueToItemBar := .T. oG2antt:Columns:Item(2):SetProperty("Def",18/*exCellValueToItemBarProperty*/,1) oG2antt:Columns:Item(4):SetProperty("Def",18/*exCellValueToItemBarProperty*/,2) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1350 |
Is posible to reduce the size of the picture to be shown in the bar's caption
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif") oG2antt:Columns():Add("Task") oG2antt:ScrollBySingleLine := .T. oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,78) oItems := oG2antt:Items() h := oItems:AddItem("Default-Size") oItems:SetProperty("ItemHeight",h,48) oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K1","<img>pic1</img>") h := oItems:AddItem("Custom-Size") oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K2","<img>pic1:18</img>") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1349 |
Is posible to reduce the size of the picture to be shown in the column's caption
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SetProperty("HTMLPicture","pic1","c:\exontrol\images\zipdisk.gif") oG2antt:HeaderHeight := 48 oG2antt:Columns():Add("DefaultSize"):HTMLCaption := "Default-Size <img>pic1</img> Picture" oG2antt:Columns():Add("CustomSize"):HTMLCaption := "Custom-Size <img>pic1:16</img> Picture" oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1348 |
Is it possible to display the selected dates using a solid color instead vertical lines
|
1347 |
How can I show the cells using a different background color based on the condition I have
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumns LOCAL oConditionalFormat,oConditionalFormat1,oConditionalFormat2 LOCAL oConditionalFormats LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:SelBackMode := 1/*exTransparent*/ oG2antt:ShowFocusRect := .F. oConditionalFormats := oG2antt:ConditionalFormats() oConditionalFormat := oConditionalFormats:Add("dbl(%1)-dbl(%0) = 1") oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oConditionalFormat:ApplyTo := 1/*0x1+*/ oConditionalFormat1 := oConditionalFormats:Add("dbl(%0)-dbl(%1) = 3") oConditionalFormat1:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. )) oConditionalFormat1:ApplyTo := 0/*exFormatToColumns*/ oConditionalFormat2 := oConditionalFormats:Add("dbl(%1)-dbl(%0) = 4") oConditionalFormat2:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oConditionalFormat2:Bold := .T. oConditionalFormat2:ApplyTo := -1/*exFormatToItems*/ oColumns := oG2antt:Columns() oColumns:Add("C1"):Width := 8 oColumns:Add("C2"):Width := 8 oColumns:Add("") oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oItems := oG2antt:Items() oItems:SetProperty("CellValue",oItems:AddItem(2),1,3) oItems:SetProperty("CellValue",oItems:AddItem(5),1,2) oItems:SetProperty("CellValue",oItems:AddItem(5),1,6) oItems:SetProperty("CellValue",oItems:AddItem(2),1,6) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1346 |
How can I specify the frame's color for all Task bars
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,128) oChart:Bars:Item("Task"):SetProperty("Def",51/*exBarFrameColor*/,255) oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/05/2001","K1") oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/05/2001","K2") oItems:AddBar(oItems:AddItem("Task 3"),"Task","01/02/2001","01/05/2001","K3") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1345 |
Is it possible to change the bar's frame color
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:DefaultItemHeight := 25 oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,128) oChart:DrawGridLines := 1/*exHLines*/ oChart:NonworkingDays := 0 oChart:Bars:Item("Task"):Height := 15 oItems := oG2antt:Items() h := oItems:AddItem("Default") oItems:AddBar(h,"Task","01/02/2001","01/05/2001","K1") h := oItems:AddItem("Red-Frame") oItems:AddBar(h,"Task","01/03/2001","01/06/2001","K1") oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,255) h := oItems:AddItem("Green-ThickFrame") oItems:AddBar(h,"Task","01/04/2001","01/07/2001","K1") oItems:SetProperty("ItemBar",h,"K1",42/*exBarPattern*/,4099) oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,32768) h := oItems:AddItem("Red-ThickFrame/Shadow") oItems:AddBar(h,"Task","01/05/2001","01/08/2001","K1") oItems:SetProperty("ItemBar",h,"K1",42/*exBarPattern*/,12291) oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,255) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1344 |
I need to customize the labels on the chart. Is it possible
|
1343 |
Is it possible to show a frame around the bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oAppearance LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:DefaultItemHeight := 25 oAppearance := oG2antt:VisualAppearance() oAppearance:Add(1,"gBFLBCJwBAEHhEJAEGg4BOUMQAAYAQGKIYBkAKBQAGaAoDDYMgzQwAAxDELMEwsACEIrjKCVIgkHYJRjGEZxMAsEwjAoaQChEZRUhEMgxDDIIyAJIcaw0GSEZwgOQZBiOEYnDANkIYJDSIYHTZIUzTJAdGSVJKNKAoKCaEgORo5SpNUghBDYKQTJyeagkaaRVCWLplRCNIwWNJdVwjEaQaaiarKNqKNpSViAEqSdKEZRLOyRZyiKQMEreY4EUDQcxUPYMNYaAC6AAparpbwCFpSYpRND3TaEE4jSLKAA0HD6QqebIDDJaFq6PbVXSTOLPNhgPQcWxeVJBXjLExUALGSYLC6nKayHZcHACKK5VbVW6ZZDdNy/BLQeD4QANG4riuNJriMV4dgWVgHh+ZpgCeEIQEQJIgGkMYdA6JwjC0VAAmaJgQgmPp4lCWgSCiaB+DKIYIjqQpllMf6JgYAoAmASAWAaAZggQDJ/gKYJIDYDoDmECBGAOBBhEgVgUgS" +; "YRoGYGYGCGKB2BCBwhmiBgLggIgoHoJIJGGKIeCiBYiiiLgXgCIpohoMIMGKGJODSCwghiZg6g6Y5InYPh/lAECAg") oAppearance:Add(2,"CP:1 2 2 -2 -2") oAppearance:Add(3,"CP:1 -5 -5 5 5") oAppearance:Add(4,"XP:Window 19 1") oAppearance:Add(5,"XP:TreeView 2 1") oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,128) oChart:DrawGridLines := 1/*exHLines*/ oItems := oG2antt:Items() h := oItems:AddItem("Default") oItems:AddBar(h,"Task","01/02/2001","01/05/2001","K1") h := oItems:AddItem("Red-Frame") oItems:AddBar(h,"Task","01/03/2001","01/06/2001","K1") oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,255) h := oItems:AddItem("Green-ThickFrame") oItems:AddBar(h,"Task","01/04/2001","01/07/2001","K1") oItems:SetProperty("ItemBar",h,"K1",42/*exBarPattern*/,4099) oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,32768) h := oItems:AddItem("Red-ThickFrame/Shadow") oItems:AddBar(h,"Task","01/04/2001","01/07/2001","K1") oItems:SetProperty("ItemBar",h,"K1",42/*exBarPattern*/,12291) oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,255) h := oItems:AddItem("EBN-Frame-Border") oItems:AddBar(h,"Task","01/05/2001","01/09/2001","K2") oItems:SetProperty("ItemBar",h,"K2",51/*exBarFrameColor*/,16777216) h := oItems:AddItem("EBN-Inside Frame") oItems:AddBar(h,"Task","01/09/2001","01/13/2001","K3") oItems:SetProperty("ItemBar",h,"K3",51/*exBarFrameColor*/,33554432) h := oItems:AddItem("EBN-Outside Frame") oItems:AddBar(h,"Task","01/15/2001","01/18/2001","K4") oItems:SetProperty("ItemBar",h,"K4",51/*exBarFrameColor*/,50331648) h := oItems:AddItem("EBN-XP Close Button") oItems:AddBar(h,"Task","01/15/2001","01/18/2001","K5") oItems:SetProperty("ItemBar",h,"K5",51/*exBarFrameColor*/,67108864) h := oItems:AddItem("EBN-XP TreeView Glyph") oItems:AddBar(h,"Task","01/15/2001","01/18/2001","K6") oItems:SetProperty("ItemBar",h,"K6",51/*exBarFrameColor*/,83886080) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1342 |
Currently your control, provides customization up to Year,Month,Day,Hours,etc. I would like to add Shifts in a day. Shortly, I need to customize the chart's header. Is it possible
|
1341 |
The exbartootip shows dates after you moved or resized the bar. My question is during the move or resizing of bar(you click on bar and drag it,during that time) , can we display the new dates simultaneously so we will know where we want to move or resize the bar to
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,64) oChart:FirstVisibleDate := "01/01/2001" oChart:DrawDateTicker := .T. oChart:DateTickerLabel := "<%mmm%> <%d%><br><b><%yyyy%>" oItems := oG2antt:Items() h := oItems:AddItem("Tasks A") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(h,"Task","01/05/2001","01/09/2001","K2") oItems:SetProperty("SelectableItem",oItems:AddItem(),.F.) h := oItems:AddItem("Tasks B") oItems:AddBar(h,"Task","01/03/2001","01/05/2001","K1") oItems:AddBar(h,"Task","01/08/2001","01/11/2001","K2") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1340 |
Is it possible to assign a tooltip automatically to all bars, so it can display the start and end, without specifying the IexBarToolTip for each bar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,64) oChart:FirstVisibleDate := "01/01/2001" oChart:Bars:Item("Task"):SetProperty("Def",6/*exBarToolTip*/,"<b><%=%9 + '/' + %C0%></b><br><upline><dotline>Start: <%=%1%><br>End: <%=%2%><br>Duration: <%=(%2-%1)%><br>Working: <%=%258%>") oItems := oG2antt:Items() h := oItems:AddItem("Tasks A") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1") oItems:AddBar(h,"Task","01/05/2001","01/09/2001","K2") h := oItems:AddItem("Tasks B") oItems:AddBar(h,"Task","01/03/2001","01/05/2001","K1") oItems:AddBar(h,"Task","01/08/2001","01/11/2001","K2") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1339 |
How can I change the color, font, bold etc for the items/cells in the same column or for the entire column
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oConditionalFormat LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oConditionalFormat := oG2antt:ConditionalFormats():Add("1") oConditionalFormat:Bold := .T. oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oConditionalFormat:ApplyTo := 1/*0x1+*/ oG2antt:Columns():Add("C1") oColumn := oG2antt:Columns():Add("C2") oColumn:HeaderBold := .T. oColumn:HTMLCaption := "<fgcolor=FF0000>C2" oItems := oG2antt:Items() oItems:SetProperty("CellValue",oItems:AddItem(10),1,11) oItems:SetProperty("CellValue",oItems:AddItem(12),1,13) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1338 |
How can I remove a date-time zone
PROCEDURE OnClick(oG2antt) oG2antt:Chart():RemoveTimeZone("Z1") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:Click := {|| OnClick(oG2antt)} /*Occurs when the user presses and then releases the left mouse button over the tree control.*/ oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,18) oChart:LevelCount := 2 oChart:FirstVisibleDate := "01/01/2010" oChart:MarkTimeZone("Z1","01/04/2010","01/08/2010",16744544) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1337 |
How can I filter the check-boxes (method 2)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oEditor LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oColumn := oG2antt:Columns():Add("Check") oEditor := oColumn:Editor() oEditor:EditType := 19/*CheckValueType*/ oEditor:SetProperty("Option",17/*exCheckValue2*/,1) oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:CustomFilter := "checked||-1|||unchecked||0" oItems := oG2antt:Items() oItems:AddItem(.T.) oItems:AddItem(.T.) oItems:AddItem(.F.) oItems:AddItem(.T.) oItems:AddItem(.F.) oItems:AddItem(.T.) oItems:AddItem(.F.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1336 |
How can I filter the check-boxes (method 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oEditor LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oColumn := oG2antt:Columns():Add("Check") oEditor := oColumn:Editor() oEditor:EditType := 19/*CheckValueType*/ oEditor:SetProperty("Option",17/*exCheckValue2*/,1) oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterType := 6/*exCheck*/ oItems := oG2antt:Items() oItems:AddItem(.T.) oItems:AddItem(.T.) oItems:AddItem(.F.) oItems:AddItem(.T.) oItems:AddItem(.F.) oItems:AddItem(.T.) oItems:AddItem(.F.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1335 |
How can add a button to control
PROCEDURE OnButtonClick(oG2antt,Item,ColIndex,Key) DevOut( "ButtonClick" ) DevOut( oG2antt:Items:CellCaption(Item,ColIndex) ) DevOut( Transform(Key,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1 LOCAL oColumns LOCAL oEditor,oEditor1 LOCAL oItems LOCAL h,s oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oG2antt,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/ oG2antt:BeginUpdate() oG2antt:DefaultItemHeight := 22 oG2antt:HeaderHeight := 22 oG2antt:Appearance := 0/*None2*/ oG2antt:DrawGridLines := -2/*exRowLines*/ oG2antt:ScrollBySingleLine := .F. oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=") oG2antt:SetProperty("HTMLPicture","pic1","c:\exontrol\images\auction.gif") oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumns := oG2antt:Columns() oColumn := oColumns:Add("Type") oColumn:Width := 48 oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn1 := oColumns:Add("Appearance") oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn1:Alignment := 1/*CenterAlignment*/ oColumn1:HeaderAlignment := 1/*CenterAlignment*/ oItems := oG2antt:Items() h := oItems:AddItem("Items.<b>CellHasButton</b> property") oItems:SetProperty("CellValue",h,1,"Button <b>1</b>") oItems:SetProperty("CellHasButton",h,1,.T.) h := oItems:AddItem("Items.<b>CellButtonAutoWidth</b> property") oItems:SetProperty("CellValue",h,1," Button <b>2</b> ") oItems:SetProperty("CellHasButton",h,1,.T.) oItems:SetProperty("CellButtonAutoWidth",h,1,.T.) h := oItems:AddItem("Items.<b>CellHasButton</b> property") oItems:SetProperty("CellValue",h,1," <img>2</img>Button <b>3</b> ") oItems:SetProperty("CellHasButton",h,1,.T.) oItems:SetProperty("CellButtonAutoWidth",h,1,.T.) h := oItems:AddItem("Items.<b>CellHasButton</b> property") oItems:SetProperty("ItemHeight",h,32) oItems:SetProperty("CellValue",h,1," <img>2</img>Button <b>4</b> <img>pic1</img> ") oItems:SetProperty("CellHasButton",h,1,.T.) oItems:SetProperty("CellButtonAutoWidth",h,1,.T.) h := oItems:AddItem("Items.<b>CellHasButton</b> in splitted cells") oItems:SetProperty("CellValue",h,1," Button <b>5.1</b> ") oItems:SetProperty("CellHasButton",h,1,.T.) oItems:SetProperty("CellButtonAutoWidth",h,1,.T.) s := oItems:SplitCell(h,1) oItems:SetProperty("CellValue",0,s," Button <b>5.2</b> ") oItems:SetProperty("CellHasButton",0,s,.T.) oItems:SetProperty("CellButtonAutoWidth",0,s,.T.) h := oItems:AddItem("Column.<b>Editor</b>, Items.<b>CellEditor</b>") oItems:SetProperty("CellValue",h,1,"Visible when clicking the cell") oEditor := oItems:CellEditor(h,1) oEditor:EditType := 1/*EditType*/ oEditor:AddButton("B1",1,0,"This is a bit of text that's shown when the cursor hovers the button B1") oEditor:AddButton("B3",2,1,"This is a bit of text that's shown when the cursor hovers the button B3") oEditor:AddButton("B4",1,1,"This is a bit of text that's shown when the cursor hovers the button B4") oEditor:ButtonWidth := 24 h := oItems:AddItem("Column.<b>Editor</b>, Items.<b>CellEditor</b>") oItems:SetProperty("CellValue",h,1,3) oEditor1 := oItems:CellEditor(h,1) oEditor1:EditType := 6/*CheckListType*/ oEditor1:AddItem(1,"Flag 1") oEditor1:AddItem(2,"Flag 2") oEditor1:AddItem(4,"Flag 4") oEditor1:AddItem(8,"Flag 8") oEditor1:AddButton("C1",1,0,"This is a bit of text that's shown when the cursor hovers the button C1") oEditor1:AddButton("C3",2,0,"This is a bit of text that's shown when the cursor hovers the button C2") oEditor1:AddButton("C4",1,0,"This is a bit of text that's shown when the cursor hovers the button C3") oEditor1:ButtonWidth := 24 oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1334 |
Is it posible to store additional values against each item, cell, bar, link, such as custom values such string / numbers etc
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,96) oG2antt:Columns():Add("Column"):Data := "Extra_Data_Column" oItems := oG2antt:Items() h := oItems:AddItem("Item 1") oItems:SetProperty("ItemData",h,"Extra_Data_Item 1") oItems:SetProperty("CellData",h,0,"Extra_Data_Item 1_Cell_0") oItems:AddBar(h,"Task","01/02/2001","01/04/2001","B1") oItems:SetProperty("ItemBar",h,"B1",17/*exBarData*/,"Extra_B1_Data") h := oItems:AddItem("Item 2") oItems:SetProperty("ItemData",h,"Extra_Data_Item 2") oItems:AddBar(h,"Task","01/06/2001","01/10/2001","B2") oItems:SetProperty("ItemBar",h,"B2",17/*exBarData*/,"Extra_B2_Data") oItems:AddLink("L1",oItems:FindItem("Item 1",0),"B1",oItems:FindItem("Item 2",0),"B2") oItems:SetProperty("Link","L1",5/*exLinkUserData*/,"Extra_Link_Data") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1333 |
How do I set the parent item to show the total number of days for its children and also the minimum and maximum dates for its children
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oColumns LOCAL oItems LOCAL h,h1,h2,h3 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:MarkSearchColumn := .F. oG2antt:Indent := 11 oG2antt:HasLines := 1/*exSolidLine*/ oG2antt:Items():AllowCellValueToItemBar := .T. oColumns := oG2antt:Columns() oColumns:Add("Tasks") oColumns:Add("Start"):SetProperty("Def",18/*exCellValueToItemBarProperty*/,1) oColumns:Add("End"):SetProperty("Def",18/*exCellValueToItemBarProperty*/,2) oColumns:Add("Duration"):SetProperty("Def",18/*exCellValueToItemBarProperty*/,513) oChart := oG2antt:Chart() oChart:ShowNonworkingDates := .F. oChart:FirstVisibleDate := "09/20/2006" oChart:AllowLinkBars := .F. oChart:AllowCreateBar := 0/*exNoCreateBar*/ oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,220) oItems := oG2antt:Items() h := oItems:AddItem("Project") oItems:AddBar(h,"Summary","09/21/2006","10/03/2006") h1 := oItems:InsertItem(h,,"Task 1") oItems:AddBar(h1,"Task","09/21/2006","09/24/2006") h2 := oItems:InsertItem(h,,"Task 2") oItems:AddBar(h2,"Task","09/24/2006","09/28/2006") h3 := oItems:InsertItem(h,,"Task 3") oItems:AddBar(h3,"Task","09/28/2006","10/03/2006") oItems:DefineSummaryBars(h,"",h1,"") oItems:DefineSummaryBars(h,"",h2,"") oItems:DefineSummaryBars(h,"",h3,"") oItems:SetProperty("ExpandItem",h,.T.) oItems:SetProperty("ItemBold",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1332 |
Is it possible to specify the distance between 2 bars to be at least 2 working days
PROCEDURE OnBarResizing(oG2antt,Item,Key) oG2antt:Items():SchedulePDM(Item,Key) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oBar LOCAL oChart LOCAL oItems LOCAL h1,h2,h3 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BarResizing := {|Item,Key| OnBarResizing(oG2antt,Item,Key)} /*Occurs when a bar is moving or resizing.*/ oG2antt:BeginUpdate() oG2antt:DefaultItemHeight := 24 oG2antt:AntiAliasing := .T. oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:LevelCount := 2 oBar := oChart:Bars():Add("Task:Split") oBar:Shortcut := "Task" oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oBar:Height := 17 oBar:Pattern := 8192/*exPatternFrameShadow*/ oChart:FirstVisibleDate := "01/03/2001" oChart:SetProperty("PaneWidth",.F.,48) oChart:LinksWidth := 2 oChart:AllowCreateBar := 0/*exNoCreateBar*/ oChart:AllowLinkBars := .F. oChart:FirstWeekDay := 1/*exMonday*/ oChart:NonworkingDaysPattern := 6/*exPatternBDiagonal*/ oItems := oG2antt:Items() h1 := oItems:AddItem("Task 1") oItems:AddBar(h1,"Task","01/04/2001","01/06/2001","K1") oItems:SetProperty("ItemBar",h1,"K1",20/*exBarKeepWorkingCount*/,.T.) h2 := oItems:AddItem("Task 2") oItems:AddBar(h2,"Task","01/02/2001","01/05/2001","K2") oItems:SetProperty("ItemBar",h2,"K2",20/*exBarKeepWorkingCount*/,.T.) oItems:AddLink("L1",h1,"K1",h2,"K2") oItems:SetProperty("Link","L1",15/*exLinkShowRound*/,-1) oItems:SetProperty("Link","L1",8/*exLinkColor*/,8421504) h3 := oItems:AddItem("Task 3") oItems:AddBar(h3,"Task","01/02/2001","01/06/2001","K3") oItems:SetProperty("ItemBar",h3,"K3",20/*exBarKeepWorkingCount*/,.T.) oItems:AddLink("L2",h2,"K2",h3,"K3") oItems:SetProperty("Link","L2",12/*exLinkText*/,"<br><br><br><br>This link <u>delays</u> the bars<br>with <b>2</b> working days") oItems:SetProperty("Link","L2",16/*exLinkPDMWorkingDelay*/,2) oItems:SetProperty("Link","L2",15/*exLinkShowRound*/,-1) oItems:SchedulePDM(0,"K1") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1331 |
The item is not getting selected when clicking the cell's checkbox. What should I do
PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex) oG2antt:Items():SetProperty("SelectItem",Item,.T.) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/ oG2antt:Columns():Add("Check"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oItems := oG2antt:Items() oItems:AddItem(0) oItems:AddItem(1) oItems:AddItem(2) oItems:AddItem(3) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1330 |
How can I add a summary item as a child or subitem of another one
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL hChild,hSummary oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:SetProperty("PaneWidth",.F.,96) oChart:FirstVisibleDate := "01/01/2011" oChart:LevelCount := 2 oG2antt:Columns():Add("Default") oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oItems := oG2antt:Items() hSummary := oItems:AddItem("Project") oItems:AddBar(hSummary,"Summary","01/01/2011","01/01/2011","Sum") hChild := oItems:InsertItem(hSummary,0,"Task 1") oItems:AddBar(hChild,"Task","01/02/2011","01/04/2011","Task1") oItems:DefineSummaryBars(hSummary,"Sum",hChild,"Task1") hChild := oItems:InsertItem(hSummary,0,"Task 2") oItems:AddBar(hChild,"Task","01/04/2011","01/06/2011","Task2") oItems:DefineSummaryBars(hSummary,"Sum",hChild,"Task2") hChild := oItems:InsertItem(hSummary,0,"Task 3") oItems:AddBar(hChild,"Task","01/06/2011","01/08/2011","Task3") oItems:DefineSummaryBars(hSummary,"Sum",hChild,"Task3") oItems:SetProperty("ExpandItem",hSummary,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1329 |
How can I make an item a subitem of another one
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL hChild,hSummary oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:Columns():Add("Default") oItems := oG2antt:Items() hSummary := oItems:AddItem("Project") hChild := oItems:InsertItem(hSummary,0,"Task 1") hChild := oItems:InsertItem(hSummary,0,"Task 2") hChild := oItems:InsertItem(hSummary,0,"Task 3") oItems:SetProperty("ExpandItem",hSummary,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1328 |
Is it possible to move a bar per drag and drop to another owner/item
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Members"):SetProperty("Def",17/*exCellValueFormat*/,1) oChart := oG2antt:Chart() oChart:FirstVisibleDate := "09/20/2006" oChart:AllowLinkBars := .F. oChart:AllowCreateBar := 0/*exNoCreateBar*/ oChart:AllowSelectObjects := 0/*exNoSelectObjects*/ oChart:LevelCount := 2 oChart:SetProperty("PaneWidth",.F.,96) oChart:Bars:Item("Task"):OverlaidType := 4611/*exOverlaidBarsIncludeCaption+exOverlaidBarsStackAutoArrange+exOverlaidBarsStack*/ oItems := oG2antt:Items() h := oItems:AddItem("Member <b>1</b>") oItems:AddBar(h,"Task","09/21/2006","09/23/2006","T102","Task <b>102</b>") oItems:SetProperty("ItemBar",h,"T102",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"T102",28/*exBarCanMoveToAnother*/,.T.) h := oItems:AddItem("Member <b>2</b>") h := oItems:AddItem("Member <b>3</b>") h := oItems:AddItem("Member <b>4</b>") oItems:AddBar(h,"Task","09/21/2006","09/23/2006","T103","Task <b>103</b>") oItems:SetProperty("ItemBar",h,"T103",4/*exBarHAlignCaption*/,18) oItems:SetProperty("ItemBar",h,"T103",28/*exBarCanMoveToAnother*/,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1327 |
I have the chart displaying days, is it possible to display bars/tasks up to hours so inside days somehow
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oChart := oG2antt:Chart() oChart:LevelCount := 2 oChart:UnitWidth := 38 oChart:SetProperty("PaneWidth",.F.,28) oChart:FirstVisibleDate := "03/04/2011" oChart:UnitScale := 4096/*exDay*/ oChart:ResizeUnitScale := 65536/*exHour*/ oG2antt:Columns():Add("Default") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("ASS"),"Task","03/07/2011","03/07/2011 03:30:00") oItems:AddBar(oItems:AddItem("EMB"),"Task","03/07/2011 03:30:00","03/08/2011 09:15:00") oItems:AddBar(oItems:AddItem("TES"),"Task","03/08/2011 09:15:00","03/08/2011 13:45:00") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1326 |
Is it possible to limit the height of the item while resizing
PROCEDURE OnAddItem(oG2antt,Item) oG2antt:Items():SetProperty("ItemMinHeight",Item,18) oG2antt:Items():SetProperty("ItemMaxHeight",Item,72) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oG2antt:BeginUpdate() oG2antt:ItemsAllowSizing := -1/*exResizeItem*/ oG2antt:ScrollBySingleLine := .F. oG2antt:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oG2antt:Columns():Add("Names") oItems := oG2antt:Items() oItems:AddItem("Mantel") oItems:AddItem("Mechanik") oItems:AddItem("Motor") oItems:AddItem("Murks") oItems:AddItem("Märchen") oItems:AddItem("Möhren") oItems:AddItem("Mühle") oG2antt:Columns:Item(0):SortOrder := 1/*SortAscending*/ oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1325 |
Is it possible to copy the hierarchy of the control using the GetItems method
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:Columns():Add("Def") oItems := oG2antt:Items() h := oItems:AddItem("Root") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oG2antt:PutItems(oG2antt:GetItems(-1)) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1324 |
I have found a property ReadOnly but this doesn't work correctly. I need the chart part of the control to be readonly too. Is it possible
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:ReadOnly := -1/*exReadOnly*/ oChart := oG2antt:Chart() oChart:AllowCreateBar := 0/*exNoCreateBar*/ oChart:BarsAllowSizing := .F. oChart:AllowLinkBars := .F. oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1323 |
How can I select a column
PROCEDURE OnMouseDown(oG2antt,Button,Shift,X,Y) oG2antt:BeginUpdate() oG2antt:Columns():Item(oG2antt:ColumnFromPoint(X,Y)):Selected := .T. oG2antt:Items():SelectAll() oG2antt:EndUpdate() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumns LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:MouseDown := {|Button,Shift,X,Y| OnMouseDown(oG2antt,Button,Shift,X,Y)} /*Occurs when the user presses a mouse button.*/ oG2antt:BeginUpdate() oG2antt:MarkSearchColumn := .F. oG2antt:SingleSel := .F. oG2antt:FullRowSelect := 1/*exRectSel*/ oG2antt:SortOnClick := 0/*exNoSort*/ oColumns := oG2antt:Columns() oColumns:Add("Column1") oColumns:Add("Column2") oItems := oG2antt:Items() oItems:SetProperty("CellValue",oItems:AddItem("One"),1,"One") oItems:SetProperty("CellValue",oItems:AddItem("Two"),1,"Two") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1322 |
I have several columns, but noticed that the filter is using AND between columns, but I need OR clause for filtering. Is it possible
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1 LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Item") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:Filter := "Child 1" oColumn:FilterType := 240/*exFilter*/ oColumn1 := oG2antt:Columns():Add("Date") oColumn1:DisplayFilterButton := .T. oColumn1:DisplayFilterPattern := .F. oColumn1:DisplayFilterDate := .T. oColumn1:FilterList := 9474/*exShowExclude+exShowFocusItem+exShowCheckBox+exNoItems*/ oColumn1:Filter := Transform("12/28/2010","") oColumn1:FilterType := 4/*exDate*/ oG2antt:FilterCriteria := "%0 or %1" oG2antt:SetProperty("Description",23/*exFilterBarOr*/,"<font ;18><fgcolor=FF0000>or</fgcolor></font>") oG2antt:SetProperty("Description",11/*exFilterBarAnd*/,"<font ;18><fgcolor=FF0000>and</fgcolor></font>") oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Child 1"),1,"12/27/2010") oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Child 2"),1,"12/28/2010") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Child 1"),1,"12/29/2010") oItems:SetProperty("CellValue",oItems:InsertItem(h,,"Child 2"),1,"12/30/2010") oG2antt:ApplyFilter() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1321 |
Is it possible exclude the dates being selected in the drop down filter window
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumn := oG2antt:Columns():Add("Date") oColumn:SortType := 2/*SortDate*/ oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:DisplayFilterDate := .T. oColumn:FilterList := 9474/*exShowExclude+exShowFocusItem+exShowCheckBox+exNoItems*/ oItems := oG2antt:Items() oItems:AddItem("12/27/2010") oItems:AddItem("12/28/2010") oItems:AddItem("12/29/2010") oItems:AddItem("12/30/2010") oItems:AddItem("12/31/2010") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1320 |
How can I display a calendar control inside the drop down filter window
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumn := oG2antt:Columns():Add("Date") oColumn:SortType := 2/*SortDate*/ oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:DisplayFilterDate := .T. oColumn:FilterList := 1282/*exShowFocusItem+exShowCheckBox+exNoItems*/ oItems := oG2antt:Items() oItems:AddItem("12/27/2010") oItems:AddItem("12/28/2010") oItems:AddItem("12/29/2010") oItems:AddItem("12/30/2010") oItems:AddItem("12/31/2010") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1319 |
Is it possible to include the dates as checkb-boxes in the drop down filter window
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumn := oG2antt:Columns():Add("Dates") oColumn:SortType := 2/*SortDate*/ oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .T. oColumn:DisplayFilterDate := .T. oColumn:FilterList := 1280/*exShowFocusItem+exShowCheckBox*/ oColumn:Filter := "to 12/27/2010" oColumn:FilterType := 4/*exDate*/ oItems := oG2antt:Items() oItems:AddItem("12/27/2010") oItems:AddItem("12/28/2010") oItems:AddItem("12/29/2010") oItems:AddItem("12/30/2010") oItems:AddItem("12/31/2010") oG2antt:ApplyFilter() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1318 |
How can I filter items for dates before a specified date
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumn := oG2antt:Columns():Add("Dates") oColumn:SortType := 2/*SortDate*/ oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .T. oColumn:DisplayFilterDate := .T. oColumn:FilterList := 1026/*exShowFocusItem+exNoItems*/ oColumn:Filter := "to 12/27/2010" oColumn:FilterType := 4/*exDate*/ oItems := oG2antt:Items() oItems:AddItem("12/27/2010") oItems:AddItem("12/28/2010") oItems:AddItem("12/29/2010") oItems:AddItem("12/30/2010") oItems:AddItem("12/31/2010") oG2antt:ApplyFilter() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1317 |
Is it possible to filter dates
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oColumn := oG2antt:Columns():Add("Dates") oColumn:SortType := 2/*SortDate*/ oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .T. oColumn:DisplayFilterDate := .T. oColumn:FilterList := 1026/*exShowFocusItem+exNoItems*/ oItems := oG2antt:Items() oItems:AddItem("12/27/2010") oItems:AddItem("12/28/2010") oItems:AddItem("12/29/2010") oItems:AddItem("12/30/2010") oItems:AddItem("12/31/2010") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1316 |
Is it possible to change the Exclude field name to something different, in the drop down filter window
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:SetProperty("Description",25/*exFilterBarExclude*/,"Leaving out") oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/ oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1315 |
How can I display the Exclude field in the drop down filter window
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/ oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1314 |
Is it possible to show and ensure the focused item from the control, in the drop down filter window
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 1280/*exShowFocusItem+exShowCheckBox*/ oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:SetProperty("SelectItem",oItems:InsertItem(h,,"Child 2"),.T.) oItems:SetProperty("ExpandItem",h,.T.) oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1313 |
Is it possible to show only blanks items with no listed items from the control
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 16386/*exShowBlanks+exNoItems*/ oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1312 |
How can I include the blanks items in the drop down filter window
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 16640/*exShowBlanks+exShowCheckBox*/ oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1311 |
How can I select multiple items in the drop down filter window, using check-boxes
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 256/*exShowCheckBox*/ oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1310 |
Is it possible to allow a single item being selected in the drop down filter window
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 128/*exSingleSel*/ oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1309 |
How can I display no (All) item in the drop down filter window
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:SetProperty("Description",0/*exFilterBarAll*/,"") oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .T. oColumn:FilterList := 2/*exNoItems*/ oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1308 |
Is it possible to display no items in the drop down filter window, so only the pattern is visible
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .T. oColumn:FilterList := 2/*exNoItems*/ oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1307 |
How can I specify the time-scale available when zoom-in/zoom-out or enlarging the chart
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,48) oChart:ShowNonworkingDates := .F. oChart:LevelCount := 3 oChart:UnitScale := 4096/*exDay*/ oChart:AllowResizeChart := 262/*exAllowChangeUnitScale+exAllowResizeChartMiddle+exAllowResizeChartHeader*/ oChart:SetProperty("Label",65536/*exHour*/,"") oChart:SetProperty("Label",1048576/*exMinute*/,"") oChart:SetProperty("Label",16777216/*exSecond*/,"") oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task A"),"Task","01/02/2001","01/06/2001","K1") oItems:AddBar(oItems:AddItem("Task B"),"Task","01/06/2001","01/10/2001","K1") oItems:AddBar(oItems:AddItem("Task C"),"Task","01/10/2001","01/14/2001","K1") oItems:AddBar(oItems:AddItem(""),"","01/08/2001","01/08/2001","Info","Click the <b>middle</b> mouse button and start dragging") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1306 |
How can I enable zoom-in/zoom-out or enlarging the chart, using the mouse middle button
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,48) oChart:ShowNonworkingDates := .F. oChart:LevelCount := 3 oChart:UnitScale := 4096/*exDay*/ oChart:AllowResizeChart := 262/*exAllowChangeUnitScale+exAllowResizeChartMiddle+exAllowResizeChartHeader*/ oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task A"),"Task","01/02/2001","01/06/2001","K1") oItems:AddBar(oItems:AddItem("Task B"),"Task","01/06/2001","01/10/2001","K1") oItems:AddBar(oItems:AddItem("Task C"),"Task","01/10/2001","01/14/2001","K1") oItems:AddBar(oItems:AddItem(""),"","01/08/2001","01/08/2001","Info","Click the <b>middle</b> mouse button and start dragging") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1305 |
How can I enable zoom-in/zoom-out or enlarging, using the chart's header
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,48) oChart:ShowNonworkingDates := .F. oChart:LevelCount := 3 oChart:UnitScale := 4096/*exDay*/ oChart:AllowResizeChart := 258/*exAllowChangeUnitScale+exAllowResizeChartHeader*/ oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task A"),"Task","01/02/2001","01/06/2001","K1") oItems:AddBar(oItems:AddItem("Task B"),"Task","01/06/2001","01/10/2001","K1") oItems:AddBar(oItems:AddItem("Task C"),"Task","01/10/2001","01/14/2001","K1") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1304 |
How can I enable resizing the chart, using the mouse middle button
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,48) oChart:ShowNonworkingDates := .F. oChart:LevelCount := 3 oChart:UnitScale := 4096/*exDay*/ oChart:AllowResizeChart := 6/*exAllowResizeChartMiddle+exAllowResizeChartHeader*/ oChart:MaxUnitWidth := 128 oChart:MinUnitWidth := 8 oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task A"),"Task","01/02/2001","01/06/2001","K1") oItems:AddBar(oItems:AddItem("Task B"),"Task","01/06/2001","01/10/2001","K1") oItems:AddBar(oItems:AddItem("Task C"),"Task","01/10/2001","01/14/2001","K1") oItems:AddBar(oItems:AddItem(""),"","01/08/2001","01/08/2001","Info","Click the <b>middle</b> mouse button and start dragging") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1303 |
How can I enable resizing the chart, using the chart's header
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oChart LOCAL oItems oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Columns():Add("Task") oChart := oG2antt:Chart() oChart:FirstVisibleDate := "01/01/2001" oChart:SetProperty("PaneWidth",.F.,48) oChart:ShowNonworkingDates := .F. oChart:LevelCount := 3 oChart:UnitScale := 4096/*exDay*/ oChart:AllowResizeChart := 2/*exAllowResizeChartHeader*/ oChart:MaxUnitWidth := 128 oChart:MinUnitWidth := 8 oItems := oG2antt:Items() oItems:AddBar(oItems:AddItem("Task A"),"Task","01/02/2001","01/06/2001","K1") oItems:AddBar(oItems:AddItem("Task B"),"Task","01/06/2001","01/10/2001","K1") oItems:AddBar(oItems:AddItem("Task C"),"Task","01/10/2001","01/14/2001","K1") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1302 |
Is it possible to auto-numbering the children items but still keeps the position after filtering
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5,oColumn6 LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oG2antt:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:FilterType := 240/*exFilter*/ oColumn:Filter := "Child 2" oColumn1 := oG2antt:Columns():Add("Pos.1") oColumn1:FormatColumn := "1 ropos ''" oColumn1:Position := 0 oColumn1:Width := 32 oColumn1:AllowSizing := .F. oColumn2 := oG2antt:Columns():Add("Pos.2") oColumn2:FormatColumn := "1 ropos ':'" oColumn2:Position := 1 oColumn2:Width := 32 oColumn2:AllowSizing := .F. oColumn3 := oG2antt:Columns():Add("Pos.3") oColumn3:FormatColumn := "1 ropos ':|A-Z'" oColumn3:Position := 2 oColumn3:Width := 32 oColumn3:AllowSizing := .F. oColumn4 := oG2antt:Columns():Add("Pos.4") oColumn4:FormatColumn := "1 ropos '|A-Z|'" oColumn4:Position := 3 oColumn4:Width := 32 oColumn4:AllowSizing := .F. oColumn5 := oG2antt:Columns():Add("Pos.5") oColumn5:FormatColumn := "'<font Tahoma;7>' + 1 ropos '-<b>||A-Z'" oColumn5:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn5:Position := 4 oColumn5:Width := 32 oColumn5:AllowSizing := .F. oColumn6 := oG2antt:Columns():Add("Pos.6") oColumn6:FormatColumn := "'<b>'+ 1 ropos '</b>:<fgcolor=FF0000>|A-Z|'" oColumn6:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn6:Position := 5 oColumn6:Width := 48 oColumn6:AllowSizing := .F. oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oG2antt:ApplyFilter() oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1301 |
Is it possible to auto-numbering the children items too
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oG2antt LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5 LOCAL oItems LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oG2antt := XbpActiveXControl():new( oForm:drawingArea ) oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/ oG2antt:create(,, {10,60},{610,370} ) oG2antt:BeginUpdate() oG2antt:Chart():SetProperty("PaneWidth",.T.,0) oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/ oG2antt:Columns():Add("Items") oColumn := oG2antt:Columns():Add("Pos.1") oColumn:FormatColumn := "1 rpos ''" oColumn:Position := 0 oColumn:Width := 32 oColumn:AllowSizing := .F. oColumn1 := oG2antt:Columns():Add("Pos.2") oColumn1:FormatColumn := "1 rpos ':'" oColumn1:Position := 1 oColumn1:Width := 32 oColumn1:AllowSizing := .F. oColumn2 := oG2antt:Columns():Add("Pos.3") oColumn2:FormatColumn := "1 rpos ':|A-Z'" oColumn2:Position := 2 oColumn2:Width := 32 oColumn2:AllowSizing := .F. oColumn3 := oG2antt:Columns():Add("Pos.4") oColumn3:FormatColumn := "1 rpos '|A-Z|'" oColumn3:Position := 3 oColumn3:Width := 32 oColumn3:AllowSizing := .F. oColumn4 := oG2antt:Columns():Add("Pos.5") oColumn4:FormatColumn := "'<font Tahoma;7>' + 1 rpos '-<b>||A-Z'" oColumn4:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn4:Position := 4 oColumn4:Width := 32 oColumn4:AllowSizing := .F. oColumn5 := oG2antt:Columns():Add("Pos.6") oColumn5:FormatColumn := "'<b>'+ 1 rpos '</b>:<fgcolor=FF0000>|A-Z|'" oColumn5:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn5:Position := 5 oColumn5:Width := 48 oColumn5:AllowSizing := .F. oItems := oG2antt:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oG2antt:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |